<?php

namespace app\controller;

use app\BaseController;
use think\Request;
use app\service\ThreeColService;
use Exception;

class ThreeCol extends BaseController
{    
    protected $middleware = [
        \app\middleware\LoginCheck::class
    ];
    protected $request;   
    protected $threeColService;
    public function __construct(Request $request,ThreeColService $threeColService)
    {       
        $this->request = $request;   
        $this->threeColService = $threeColService;     
    }    

    public function index()
    {       
        try {      
            $params = $this->request->param();       
            $data = $this->threeColService->index($params);
        } catch (Exception $e) {
            return $this->error($e->getMessage());
        }

        return $this->success($data);
    }   

    public function yuer()
    {       
        try {           
            $params = $this->request->param();         
            $data = $this->threeColService->yuer($params);
        } catch (Exception $e) {
            return $this->error($e->getMessage());
        }

        return $this->success($data);
    }
    
}
